package com.gome.axwl.aoc.service.impl;

import com.gome.axwl.aoc.dao.CsLicenseInfoDao;
import com.gome.axwl.aoc.entity.po.CsLicenseInfoPo;
import com.gome.axwl.aoc.service.CsLicenseInfoService;
import com.gome.datasource.shard.annotation.ReadDatasource;
import com.gome.datasource.shard.annotation.WriteDatasource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @Auther: yinyuxin@gome.com.cn
 * @Date: 2018/7/16 11:08
 */
@Service("csLicenseInfoService")
public class CsLicenseInfoServiceImpl implements CsLicenseInfoService {

    @Autowired
    private CsLicenseInfoDao csLicenseInfoDao;

    @Override
    @ReadDatasource
    public CsLicenseInfoPo queryById(Integer id) {
        return csLicenseInfoDao.selectByPrimaryKey(id);
    }

    @Override
    @WriteDatasource
    public void insert(CsLicenseInfoPo csLicenseInfoPo) {
        csLicenseInfoDao.insertSelective(csLicenseInfoPo);
    }

    @Override
    @WriteDatasource
    public void update(CsLicenseInfoPo csLicenseInfoPo) {
        csLicenseInfoDao.updateByPrimaryKeySelective(csLicenseInfoPo);
    }
}
